DOCKER is an open-source application container engine for providing an automatic deployment solution of an application. A container is quickly created in a LINUX system. The container is a lightweight virtual machine, and deploys and operates an application. In addition, it may be very convenient and easy to implement automatic installation, deployment, and upgrade of the application by means of file configuration. The DOCKER virtualizes multiple containers. The containers are separated from each other, and no interface exists. Therefore, production environment and development environment of a container may be separated from those of another container, and therefore, do not affect those of the other container.
Currently, a footstone of a cloud service is operating system level separation. One or more virtual machines operate services on a same host machine. However, the DOCKER implements application level separation, changes a basic development unit and an operating unit, and converts direct operation of the virtual machine into operation of a “container” operated by the application. As a DOCKER container technology is gradually used in a development environment, a testing environment, and a production environment, how to operate, in the DOCKER, an application previously established in the virtual machine is an important problem currently researched.
A solution in other approaches is as follows. A developer researches deployment of an application on the virtual machine, including information about the application such as a deployment architecture, a deployment component, an installation configuration manner, or a commissioning manner. Then, the developer establishes, according to a DOCKER container image requirement, a container image corresponding to the application, performs deployment, configuration, and testing on the established container image, stores the container image of the application in a DOCKER container image registry after the testing succeeds, and invokes and operates the container image of the application from the container image registry when the application needs to be operated.
It can be learned that in the foregoing method, when a virtual machine image of the application previously established in the virtual machine operates, the virtual machine image of the application first needs to be manually converted into a container image. In this method, the developer needs to research the deployment of the application on the virtual machine, further needs to learn of the DOCKER container image requirement, and establishes the container image of the application. A requirement for the developer is relatively high in this process. In addition, the deployment of the application on the virtual machine is relatively time-consuming and complex. This wastes much energy and time of the developer.
Based on the above, it is urgent to provide a DOCKER container operating method and apparatus in order to operate, in the DOCKER container using a simple and efficient method, the application previously established in the virtual machine.